package com.woniuxy.account.controller;

import com.woniuxy.account.pojo.Account;
import com.woniuxy.account.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class AccountController {
    @Autowired
    private AccountService accountService;

    @RequestMapping("/updateMoneyByid/{id}/{money}")
    public boolean updateMoneyByid(@PathVariable("id") Integer id,@PathVariable("money") Integer money){
        return accountService.lambdaUpdate()
                .eq(Account::getId,id)
                .set(Account::getMoney,money)
                .update();
    }


}
